<!DOCTYPE html>
<#assign fillDept=JspTaglibs["http://www.casic304.cn/fillDept"] />
<html>
<head>
    <meta charset="utf-8">
    <title>子标准条款基本信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${ctx}/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/iconfont/iconfont.css"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/style/qbdms.css">
    <script type="text/javascript">
        var __ctx = "${ctx}";
    </script>
    <style>
        .qbdms-TBinformation {
            margin-left: 0
        }
    </style>
</head>
<body class="listBody">
<div class="qbdms-bodyDiv">
    <div class="qbdms-backDiv">
        <div class="layui-table-view-body" style="padding: 0 24px 24px;">
            <div class="qbdms-formTitle" style="border-bottom: 1px solid #E5F0FF">子标准条款维护 <i class="qbdms-returnOn closeWindow">返回</i></div>
            <form class="layui-form treeFormPreview" requrl="${ctx}/qbdms/wQbdSubStandardClause/get" lay-filter="wQbdSubStandardClauseDataForm" style="padding-left: 80px">
                <@fillDept.dept id="tbxx"/>
                <div class="layui-row">
                    <div style="width: 56%">
                        <label class="layui-form-label qbdms-label" title="依据标准">标准条款<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <select id="standardClause" name="standardClause" placeholder="请输入" lay-filter="standardClause" lay-verify="required" lay-reqtext="标准条款是必选项" lay-search=""></select>
                        </div>
                    </div>
                    <div style="width: 56%">
                        <label class="layui-form-label qbdms-label" title="子标准条款">子标准条款<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" name="subStandardClause" placeholder="请输入" lay-verify="required" lay-reqtext="子标准条款是必填项" autocomplete="off" class="layui-input" maxlength="50">
                        </div>
                    </div>
                    <div style="width: 56%">
                        <label class="layui-form-label qbdms-label" title="子标准条款内容">子标准条款内容<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" name="subStandardClauseContent" placeholder="请输入" lay-verify="required" lay-reqtext="子标准条款内容是必填项" autocomplete="off" class="layui-input" maxlength="50">
                        </div>
                    </div>
                    <div style="width: 56%">
                        <label class="layui-form-label qbdms-label" title="排序号">排序号<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" id="sortId" name="sortId" placeholder="请输入" lay-verify="required|num" lay-reqtext="排序号是必填项" autocomplete="off" class="layui-input" maxlength="10">
                        </div>
                    </div>
                </div>
                <div class="layui-hide">
                    <input type="text" name="id" placeholder="请输入" autocomplete="off" class="layui-input textInput" maxlength="50">
                    <input type="text" id="standardClauseId" name="standardClauseId" placeholder="请输入标准条款id" autocomplete="off" class="layui-input textInput" maxlength="50">
                </div>
                <div class="layui-form-item" style="margin-top: 48px">
                    <p style="text-align: left;margin-left: 144px;">
                        <a lay-submit lay-filter="wQbdSubStandardClause" class="layui-btn privateSubmit qbdms-oneBtn" requrl="${ctx}/qbdms/wQbdSubStandardClause/save">提交</a>
                        <button type="reset" id="closeWindow" style="margin-left: 10px;" class="layui-btn   layui-btn-sm btn-save qbdms-oneBtnLine">取消</button>
                    </p>
                </div>
            </form>
        </div>
    </div>
</div>
<script src="${ctx}/qbdmsStatic/public/configFile.js"></script>
<script src="${ctx}/layui/layui.js"></script>
<script>
    layui.config({
        base: serverPath.qbdmsPath + staticPath.qbdmsPath //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'setter', 'common', 'jquery', 'publicMethods','qbdmsForm'], function () {
        var form = layui.qbdmsForm;
        var common = layui.common;
        var $ = layui.jquery;
        var publicMethods = layui.publicMethods;
        //关闭当前页面
        $("#closeWindow,.closeWindow").click(function () {
            window.location.href = serverPath.qbdmsPath + '/qbdms/wQbdSubStandardClause/view/list';
        });

        form.verify({
            num: function (value) {
                // 如果值为空，不触发校验
                if (value && !new RegExp(/^[1-9]\d*$/).test(value)) return "只能输入非负整数";
            }
        });

        var runId = "${runId}";
        if (runId == null || runId == '') {
            $("#hideAndShow").show();
        }
        var id = "${id}";
        var sortId = "${sortId}";
        if (id == null || id == '') {
            $("#sortId").val(sortId);
        }
        var wQbdStandardClauseList = eval('${wQbdStandardClauseList}');
        var standardClauseHtml = "<option></option>";
        $.each(wQbdStandardClauseList, function (index, obj) {
            standardClauseHtml += "<option data-id='" + obj.id + "' value='" + obj.standardClause + "'>" + obj.standardClause + "</option>";
        });
        $("#standardClause").html(standardClauseHtml);

        form.on('select(standardClause)', function (data) {
            $("#standardClauseId").val(data.elem[data.elem.selectedIndex].getAttribute("data-id"));
        });
        if (sortId.length > 10) {
            layer.alert(publicMethods.confirmStyle("子标准条款录入已达系统允许上限！"), {title: false, skin: 'confirm-class'});
            return false;
        } else {
            common.updateForm({
                name: 'wQbdSubStandardClauseDataForm',
                idValue: "${id}",
                primary: "id",
                getCallback: function (data) {
                    $("#tbxx").html("<span class='qbdms-TBinformation'>填报信息:</span><span class='qbdms-TBinformationText'>【" + data.data.filldept + " | " + data.data.fillman + " | " + data.data.filldate + "】</span>");
                },
                updateCallback: function (data) {
                    if (publicMethods._filterRecord(data)) {
                        if ($(".privateSubmit")) {
                            $(".privateSubmit").attr("disabled", false).css("pointer-events", "auto");
                        }
                        layer.alert(publicMethods.confirmStyle(data.msg), {title: false, skin: 'confirm-class'}, function (index) {
                            layer.close(index);
                            window.location.href = serverPath.qbdmsPath + '/qbdms/wQbdSubStandardClause/view/list';
                        });
                    } else {
                        layer.alert(publicMethods.confirmStyle(data.msg),{title: false, skin: 'confirm-class'});
                    }
                    return false;
                }
            });
        }
    });
</script>
</body>
</html>